<?php

namespace Database\Seeders;

use App\Models\Role;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class RoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        Role::factory(3)->create();
        $role = Role::where('id', '1')->first();
        $role->code = 'superAdmin';
        $role->name = '超级管理员';
        $role->status = 1;
        $role->description = '超级管理员';
        $role->save();

        $role2 = Role::where('id', '2')->first();
        $role2->code = 'business';
        $role2->name = '商家';
        $role2->status = 1;
        $role2->description = '商家';
        $role2->save();

        $role3 = Role::where('id', '3')->first();
        $role3->code = 'ordinaryUser';
        $role3->name = '普通用户';
        $role3->status = 1;
        $role3->description = '普通用户';
        $role3->save();
    }
}
